package com.fyzk.activity.trend;

import com.tyjc.lottery.R;
import com.fyzk.utils.LogUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanxs11 on 2017/7/16.
 */

public class Gp11x5TrendBean extends TrendBean{
    @Override
    public List<List<String>> getMissValues(int payType, int chooseId, String missTitle, String hcTitle) {
        List<List<String>> missValues = new ArrayList<>();
        if (issues == null || issues.size() == 0 || misses == null || misses.size() == 0 || hcs == null || hcs.size() == 0) {
            return missValues;
        }

        switch (chooseId) {
            case R.id.trend_choose_rb1:     // 第一个选项卡——开奖
                for (int i = 0; i < issues.size(); i++) {
                    IssuesBean issuesBean = issues.get(i);
                    List<String> missNums = new ArrayList<>();
                    missNums.add(issuesBean.getWincode());  // 开奖号码
                    missNums.add(issuesBean.getAndValue());      // 和值
                    missNums.add(issuesBean.getSpanValue());     // 跨度
                    missValues.add(missNums);
                }
                return missValues;
            case R.id.trend_choose_rb2:     // 第二个选项卡——走势

                return getZouShi(missTitle);
            case R.id.trend_choose_rb3:
                switch (payType) {
                    case 8:     // 前二直选走势
                    case 10:    // 前三直选走势

                        return getZouShi(missTitle);
                    default:    // 冷热数据

                        HcsBean hcsBean30 = hcs.get(0);
                        HcsBean hcsBean50 = hcs.get(1);
                        HcsBean hcsBean100 = hcs.get(2);
                        // 最新期遗漏
                        List<String> zouShiMiss = getOneZouShi(misses.size()-1,missTitle);

                        for (int i = 0; i < 11; i++) {

                            List<Integer> hcs30Misses = hcsBean30.getHcValues(hcTitle);
                            List<Integer> hcs50Misses = hcsBean50.getHcValues(hcTitle);
                            List<Integer> hcs100Misses = hcsBean100.getHcValues(hcTitle);

                            List<String> missNums = new ArrayList<>();
                            try {
                                missNums.add(hcs30Misses.get(i)+"");    // 30期冷热
                                missNums.add(hcs50Misses.get(i)+"");    // 50期冷热
                                missNums.add(hcs100Misses.get(i)+"");   // 100期冷热
                            } catch (IndexOutOfBoundsException e) {
                                LogUtil.d(e.getMessage());
                            }

                            if (i < zouShiMiss.size()) {
                                missNums.add(zouShiMiss.get(i));
                            } else {
                                missNums.add("-");
                            }

                            missValues.add(missNums);
                        }
                        this.maxMiss[0] = hcsBean30.maxHc+"";
                        this.maxMiss[1] = hcsBean50.maxHc+"";
                        this.maxMiss[2] = hcsBean100.maxHc+"";
                        return missValues;
                }
            case R.id.trend_choose_rb4:
                switch (payType) {
                    case 10:    // 前三直选走势

                        return getZouShi(missTitle);
                    default:    // 形态数据

                        for (int i = 0; i < issues.size(); i++) {
                            IssuesBean issuesBean = issues.get(i);
                            List<String> missNums = new ArrayList<>();
                            missNums.add(issuesBean.getWincode());       // 开奖号码
                            missNums.add(issuesBean.getBigsmall());      // 大小比
                            missNums.add(issuesBean.getOddEvenValue());  // 奇偶比
                            missNums.add(issuesBean.getPrimeValue());    // 质合比
                            missValues.add(missNums);
                        }
                        return missValues;
                }

            default:
                break;
        }

        return missValues;
    }
}
